import {CopyProperty} from "hongshu-view";
import {defineStore} from "pinia";

export const useUserInfoStore = defineStore("userInfo",{
    state:()=>{
       return {
        userId:"",
        mobileUserId:"",//
        avatar:"",//
        token:"",
        username:"",//
        nickname:"",//
        mobileTel:"",//
        useType:"",//
        tenantName:"",//
        tenantId:"",
        realname:"",//
        deptName:"",//部门名称
       }
    },
    actions:{
        updateUserInfo(info){
            CopyProperty(this,info);
        },

        updateToken(token){
            this.token = token;
        }
    },
    getters:{
        getToken(state){
            return state.token;
        }
    }
}) 